using Tools.Common.ServiceLocator;
using Tools.Domain.Specifications.Constraints;
using Webshop20.Application.Queries.Messages;
using Webshop20.Domain.Security.Authentication.Core;

namespace Webshop20.Application.Queries.Services
{
    public interface IGetAccountValidationInformationService : IService{}

    public class GetAccountValidationInformationService : ServiceBase, IGetAccountValidationInformationService
    {
        private IServiceLocator serviceLocator;

        public GetAccountValidationInformationService(IServiceLocator serviceLocator)
        {
            this.serviceLocator = serviceLocator;
        }

        public override ISystemMessage Handle(ISystemMessage request)
        {
            IConstraintSet<Account> accountValidationInformation = serviceLocator.Resolve<IConstraintSet<Account>>();
            return new GetAccountValidationInformationResponse(accountValidationInformation);
        }

    }
}